package com.eight.weather.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.eight.weather.entity.WeatherEntity;
import com.eight.weather.mapper.WeatherMapper;
import org.springframework.stereotype.Service;

//张和积
@Service
public class WeatherService extends ServiceImpl<WeatherMapper, WeatherEntity> {

    // 新增天气信息
    public boolean addWeather(WeatherEntity weatherEntity) {
        return save(weatherEntity);
    }

    // 删除天气信息
    public boolean deleteWeatherById(Long id) {
        return removeById(id);
    }

    // 修改天气信息
    public boolean updateWeather(WeatherEntity weatherEntity) {
        return updateById(weatherEntity);
    }

    // 查询天气信息
    public WeatherEntity getWeatherById(Long id) {
        return getById(id);
    }
}